﻿using System;
using System.ComponentModel.DataAnnotations;

namespace NetSurveillance.WebApp.Models
{
    public class IMDataSearchModel
    {

        public long? Id { get; set; }

        [Required]
        [StringLength(255)]
        public string Content { get; set; }

        [StringLength(32)]
        public string Protocol { get; set; }

        [DataType(DataType.DateTime)]
        [Display(Name = "开始")]
        public DateTime? StartDate { get; set; }

        [DataType(DataType.DateTime)]
        [Display(Name = "结束")]
        public DateTime? EndDate { get; set; }

        [StringLength(32)]
        [Display(Name = "账号")]
        public string Account { get; set; }

        [StringLength(32)]
        [Display(Name = "备注姓名")]
        public string Alias { get; set; }

        [StringLength(32)]
        [Display(Name = "对方账号")]
        public string TheOtherAccount { get; set; }

        [StringLength(32)]
        [RegularExpression(@"^(\d{1,2}|1\d\d|2[0-3]\d|22[0-3])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$", ErrorMessage = "Ip is not validate")]
        [Display(Name = "主机IP")]
        public string IP { get; set; }

        [StringLength(32)]
        [Display(Name = "主机Mac")]
        public string Mac { get; set; }

        [StringLength(32)]
        [RegularExpression(@"^(\d{1,2}|1\d\d|2[0-3]\d|22[0-3])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$", ErrorMessage = "Remote Ip is not validate")]
        [Display(Name = "远程IP")]
        public string RemoteIP { get; set; }

        [StringLength(32)]
        [Display(Name = "远程Mac")]
        public string RemoteMac { get; set; }

        [StringLength(200)]
        [Display(Name = "文件名")]
        public string FileName { get; set; }

        public string SearchFrom { get; set; }
    }
}